<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmcPromotionCouponTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cmc_promotion_coupon', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->default('')->comment('优惠券名称');
            $table->integer('integral')->comment('兑换消耗');
            $table->decimal('coupon_price')->default('0.00')->comment('兑换优惠券值');
            $table->integer('coupon_time')->comment('优惠券有效期(天)');
            $table->integer('sort')->comment('排序');
            $table->tinyInteger('status')->comment('优惠券状态');
            $table->dateTime('add_time')->comment('兑换开始时间');
            $table->tinyInteger('id_del')->comment('是否删除');
            $table->string('product_id')->default('')->comment('所属商品ID');
            $table->string('category_id')->default('')->comment('所属分类');
            $table->tinyInteger('type')->comment('优惠券类型');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cmc_promotion_coupon');
    }
}
